<!DOCTYPE html>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <META NAME="MobileOptimized" CONTENT="yes">
    <!--�ƶ��Ż�-->
    <meta name="apple-touch-fullscreen" content="yes" />
    <!--ȫ��-->
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!--��վ������web app�����֧�֡�-->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <title>��Ʒ����</title>
    <!-- import CSS -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <style>
        .el-carousel__item h3 {
            color: #475669;
            font-size: 14px;
            opacity: 0.75;
            line-height: 150px;
            margin: 0;
        }

        .title {
            font-size: 1.4rem;
            color: red;
            margin: 0.2rem 0;
        }

        .goodsname {
            font-size: 0.9rem;
        }

        .postfee {
            font-size: 0.8rem;
            margin: 0.2rem 0;
            color: gray;
            line-height: 2.2rem;
        }

        #app {
            background-color: lightgrey;
        }

        .white {
            background-color: white;
        }

        .el-icon-arrow-right:before {
            line-height: 2.2rem;
        }

        .el-button {
            padding: 0;
            border: 0 solid #DCDFE6;
        }

        img {
            width: 100%;
            height: 100%;
        }

        .el-popper {
            width: 90%;
        }
    </style>
</head>
<body>
<div id="app">
    <div class="block">
        <el-carousel>
            <el-carousel-item v-for="(img,index) of goods.imgs" :key="index" :img="img">
                <img :src="img.img"/>
            </el-carousel-item>
        </el-carousel>
    </div>
    <el-row class="white">
        <div class="title">��{{goods.basePrice}}</div>
    </el-row>
    <el-row class="white">
        <div class="goodsname">{{goods.goodsName}}</div>
    </el-row>
    <el-row class="white">
        <div class="postfee" style="float: left;">���:{{goods.postFee}}</div>
        <div class="postfee" style="float: right;">����:{{goods.goodsSaleNum}}</div>
    </el-row>
    <el-row class="white postfee prop">
        <div style="float: left;">���</div>
        <el-button style="float: right;" v-popover:popover4 class="el-icon-arrow-right"></el-button>
    </el-row>
    <el-popover ref="popover4" placement="buttom-start" width="90%" trigger="click">
        <el-row v-for="(prop,index) of goods.props" :key="index" :prop="prop">
            <el-row>
                {{prop.propName}}
            </el-row>
            <el-row>
                <el-col :span="6" v-for="(pro,index) of prop.prop" :key="index" :pro="pro">
                    {{pro.goodsPropVal}}
                </el-col>
            </el-row>
        </el-row>
    </el-popover>
    <el-row>
        <div class="postfee" style="text-align: center;line-height: 1.4rem;">-- �������� --</div>
    </el-row>
    <el-row class="white">
        <div v-html="goodsDesc"></div>
    </el-row>
    <el-row class="white" style="text-align: center; padding: 0.6rem 0;">
        <a :href="applink">
            <el-button type="danger" size="small" round>����APP�鿴</el-button>
        </a>
    </el-row>
</div>

</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
    //��ȡ����ֵ
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }

    new Vue({
        el: '#app',
        data: {
            goodsId: '',
            goods: {},
            goodsDesc: '',
            applink: ''
        },
        created: function () {
            this.getGoodsId();
            this.getGoodsInfo();
            this.getGoodsDesc();
        },
        methods: {
            getGoodsId: function () {
                this.goodsId = getQueryString("goodsId");
            },
            getGoodsInfo: function () {
				this.applink = "android://wangzhe/good?id=" + this.goodsId + "&type=1&goodsType="+this.goods.goodsType;
                this.$http.post('/api/getGoodsInfo?goodsId=' + this.goodsId).then(function (data) {
                    if (data.body.code === 0) {
                        this.goods = data.body.goods;
                        var u = navigator.userAgent, app = navigator.appVersion;
                        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android�ն˻���uc�����
                        var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios�ն�
                        if (isiOS) {
                            this.applink = "wangzheshopping://?id=" + this.goodsId + "&type=1&goodsType="+this.goods.goodsType;
                        }
                        if (isAndroid) {
                            this.applink = "android://wangzhe/good?id=" + this.goodsId + "&type=1&goodsType="+this.goods.goodsType;
                        }
                    } else {
                        /* this.$message.error(data.body.msg); */
                    }
                }, function (response) {
                    console.info(response);
                })
            },
            getGoodsDesc: function () {
                this.$http.post('/api/share/getGoodsDesc?goodsId=' + this.goodsId).then(function (data) {
                    if (data.body.code === 0) {
                        this.goodsDesc = data.body.goods.goodsDesc;
                    } else {
                        /* this.$message.error(data.body.msg); */
                    }
                }, function (response) {
                    console.info(response);
                })
            }
        }
    })
</script>

<div>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>

    aaaaaaaaaaaaaaaaaaaaaaaaa<br>
    bbbbbbbbbbbbbbbbbbbbb<br>
    eeeeeeeeeeeeeeeee<br>
</div>
</html>
